﻿@using CommonApp
@using IBS.Model
@model CommonApp.Models.UserRequest

@{
    ViewBag.Title = "User Request";
    Layout = "~/Views/Requests/_RequestsLayout.cshtml";
}

<h2>Request @Model.Id</h2>

@Html.HiddenFor(m => m.Id)

<table>
    <tr>
        <td>@Html.LabelFor(m => m.ClientId)</td>
        <td>@Html.DisplayFor(m => m.ClientId)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.Login)</td>
        <td>@Html.DisplayFor(m => m.Login)</td>
    </tr>    
    <tr>
        <td>@Html.LabelFor(m => m.FirstName)</td>
        <td>@Html.DisplayFor(m => m.FirstName)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.LastName)</td>
        <td>@Html.DisplayFor(m => m.LastName)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.PassportSeries)</td>
        <td>@Html.DisplayFor(m => m.PassportSeries)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.PassportNumber)</td>
        <td>@Html.DisplayFor(m => m.PassportNumber)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.Email)</td>
        <td>@Html.DisplayFor(m => m.Email)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.DateOfBirth)</td>
        <td>@Html.DisplayFor(m => m.DateOfBirth)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.Status)</td>
        <td>@Html.DisplayFor(m => m.Status)</td>
    </tr>
    <tr>
        <td>@Html.LabelFor(m => m.SubmitDate)</td>
        <td>@Html.DisplayFor(m => m.SubmitDate)</td>
    </tr>
</table>

 @section scriptRequests {
    <script src="@Url.Content("~/Scripts/requestsDetails.js")" type="text/javascript"></script>
}
    
@Html.ActionLink("Approve", "Notify", new { Model.Id }).If(Model.Status != RequestStatus.Approved)
@Html.ActionLink("Reject", "Reject", new { Model.Id }).If(Model.Status == RequestStatus.New)
@Html.ActionLink("Register User", "RegisterUser", new { Model.Id, Model.ClientId }).If(Model.Status == RequestStatus.Approved)
